package br.com.foxinline.modelo;

import br.com.foxinline.enums.Status;
import br.com.foxinline.generico.EntidadeGenerica;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author elyjunior
 */
@Entity
public class TramiteRequerimento extends EntidadeGenerica implements Serializable {

    @Id
    @SequenceGenerator(sequenceName = "seq_tramite", name = "seq_tramite", allocationSize = 1)
    @GeneratedValue(generator = "seq_tramite", strategy = GenerationType.SEQUENCE)
    private Long id;
    @OneToOne
    private Usuario usuario;
    @Enumerated(EnumType.STRING)
    private Status status;
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataTramite;
    
//    private Requerimento requerimento;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Date getDataTramite() {
        return dataTramite;
    }

    public void setDataTramite(Date dataTramite) {
        this.dataTramite = dataTramite;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 59 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 59 * hash + (this.usuario != null ? this.usuario.hashCode() : 0);
        hash = 59 * hash + (this.status != null ? this.status.hashCode() : 0);
        hash = 59 * hash + (this.dataTramite != null ? this.dataTramite.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TramiteRequerimento other = (TramiteRequerimento) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if (this.usuario != other.usuario && (this.usuario == null || !this.usuario.equals(other.usuario))) {
            return false;
        }
        if (this.status != other.status) {
            return false;
        }
        if (this.dataTramite != other.dataTramite && (this.dataTramite == null || !this.dataTramite.equals(other.dataTramite))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "TramiteRequerimento{" + "id=" + id + ", usuario=" + usuario + ", status=" + status + ", dataTramite=" + dataTramite + '}';
    }
}
